﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.ComponentModel;

namespace xTeam.HengLe.Controller.Manage
{
    public class SecurityController : Controller.BaseController
    {
        public ActionResult Login()
        {
            return View();
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="name">登录名</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult Login([DefaultValue("")]string userName, [DefaultValue("")]string password)
        {
            if (userName == "admin" && password == "1qaz@WSX")
            {
                System.Web.Security.FormsAuthentication.RedirectFromLoginPage(userName, true);

            }
            return Content("用户名或密码错误");
        }
        /// <summary>
        /// 登出
        /// </summary>
        public ActionResult LogOut()
        {
            System.Web.Security.FormsAuthentication.SignOut();
            return Redirect("/");
        }
    }
}
